package com.have.blog.base.validator.constraint;

import com.have.blog.base.validator.annotation.BooleanNotNull;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class BooleanValidator implements ConstraintValidator<BooleanNotNull, Boolean> {

    @Override
    public void initialize(BooleanNotNull constraintAnnotation) {

    }

    @Override
    public boolean isValid(Boolean value, ConstraintValidatorContext constraintValidatorContext) {
        if (value == null) {
            return false;
        }
        return true;
    }
}
